package com.demo222_求完全二叉树的结点数量;
class TreeNode {
    int val;
    TreeNode left = null;
    TreeNode right = null;

    public TreeNode(int val) {
        this.val = val;
    }

    public TreeNode() {
    }
}
public class Solution_后序遍历 {
    public int countNodes(TreeNode root) {
        if (root==null){
            return 0;
        }
        int left=countNodes(root.left);
        int right=countNodes(root.right);

        return left+right+1;
    }
}
